package main

import (
	"fmt"
	"golang.org/x/net/html"
	"os"
)

func main() {
	doc, _ := html.Parse(os.Stdin)

	fmt.Printf("%T\n", doc) //类型*html.Node
	fmt.Println(doc)        //指针&{<nil> 0xc420048150 0xc4200481c0 <nil> <nil> 2    []}
	// fmt.Printf("%v", doc)   //指针&{<nil> 0xc420048150 0xc4200481c0 <nil> <nil> 2    []}
	fmt.Println(doc.Type)                   //2
	fmt.Println(doc.Attr)                   //[]
	fmt.Println(doc.FirstChild.Attr)        //[{ public -//W3C//DTD XHTML 1.0 Transitional//EN} { system http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd}]
	fmt.Println(doc.FirstChild.Attr[0].Key) //public
	fmt.Println(doc.FirstChild.Attr[1].Key) //system
	// fmt.Println(doc.NextSibling)
}
